package short_semester.questionnaire_planet.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import short_semester.questionnaire_planet.dao.QuestionSequenceDao;
import short_semester.questionnaire_planet.pojo.QuestionSequence;

@Service
public class QuestionSequenceService {
    @Autowired
    QuestionSequenceDao sequenceDao;
    
    public void setSequence(String type,Integer questionId,Integer sequence){
        QuestionSequence questionSequence = sequenceDao.findByTypeAndQuestionId(type, questionId);
        questionSequence.setSequence(sequence);
        sequenceDao.save(questionSequence);
    }
}
